package com.hq.door.pojo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import com.fasterxml.jackson.annotation.JsonIgnore;


/**
 * AbstractTClass entity provides the base persistence definition of the TClass entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass

public abstract class AbstractTClass  implements java.io.Serializable {


    // Fields    

     private Integer id;
     private TTeacher TTeacher;
     private TMajor TMajor;
     private String name;
     private String code;
     private Timestamp modifiedTime;
     private Integer modifiedBy;
     private String grade;
     private Set<TStudent> TStudents = new HashSet<TStudent>(0);


    // Constructors

    /** default constructor */
    public AbstractTClass() {
    }

	/** minimal constructor */
    public AbstractTClass(String name, String code) {
        this.name = name;
        this.code = code;
    }
    
    /** full constructor */
    public AbstractTClass(TTeacher TTeacher, TMajor TMajor, String name, String code, Timestamp modifiedTime, Integer modifiedBy, String grade, Set<TStudent> TStudents) {
        this.TTeacher = TTeacher;
        this.TMajor = TMajor;
        this.name = name;
        this.code = code;
        this.modifiedTime = modifiedTime;
        this.modifiedBy = modifiedBy;
        this.grade = grade;
        this.TStudents = TStudents;
    }

   
    // Property accessors
    @Id @GeneratedValue
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
	@OneToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="master_teacher",unique=true)
    public TTeacher getTTeacher() {
        return this.TTeacher;
    }
    
    public void setTTeacher(TTeacher TTeacher) {
        this.TTeacher = TTeacher;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="major_id")

    public TMajor getTMajor() {
        return this.TMajor;
    }
    
    public void setTMajor(TMajor TMajor) {
        this.TMajor = TMajor;
    }
    
    @Column(name="name", nullable=false, length=100)

    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="code", nullable=false, length=30)

    public String getCode() {
        return this.code;
    }
    
    public void setCode(String code) {
        this.code = code;
    }
    
    @Column(name="modified_time", length=19)

    public Timestamp getModifiedTime() {
        return this.modifiedTime;
    }
    
    public void setModifiedTime(Timestamp modifiedTime) {
        this.modifiedTime = modifiedTime;
    }
    
    @Column(name="modified_by")

    public Integer getModifiedBy() {
        return this.modifiedBy;
    }
    
    public void setModifiedBy(Integer modifiedBy) {
        this.modifiedBy = modifiedBy;
    }
    
    @Column(name="grade", length=20)

    public String getGrade() {
        return this.grade;
    }
    
    public void setGrade(String grade) {
        this.grade = grade;
    }
@OneToMany(fetch=FetchType.LAZY, mappedBy="TClass")

    public Set<TStudent> getTStudents() {
        return this.TStudents;
    }
    
    public void setTStudents(Set<TStudent> TStudents) {
        this.TStudents = TStudents;
    }
   








}